/*
 * \brief  Memory touch helpers
 * \author Norman Feske
 * \date   2007-04-29
 */

/*
 * Copyright (C) 2007-2009 Norman Feske
 * Genode Labs, Feske & Helmuth Systementwicklung GbR
 *
 * This file is part of the Genode OS framework, which is distributed
 * under the terms of the GNU General Public License version 2.
 */

#ifndef _INCLUDE__X86__CPU__TOUCH_H_
#define _INCLUDE__X86__CPU__TOUCH_H_

namespace Genode {

	/**
	 * Touch memory read only
	 */
	inline void touch_read(const void *addr)
	{
		asm volatile("or	%0,%%eax \n"
		 :
		 : "m" (*(const unsigned *)addr)
		 : "eax" );
	}

	inline void touch_read_write(const void *addr)
	{
		asm volatile("or	$0,%0 \n"
		 :
		 : "m" (*(const unsigned*)addr));
	}
}

#endif /* _INCLUDE__X86__CPU__TOUCH_H_ */
